<%@page import="helpers.UrlHelper"%>
<%@page import="entities.OwnerDomain"%>
<%@page import="java.util.TreeMap"%>
<%
TreeMap check = (TreeMap) request.getAttribute("check");
String success = (String) request.getAttribute("success");
String form = (String) request.getAttribute("form");
OwnerDomain ownerDomain = (OwnerDomain) request.getAttribute("ownerDomain");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp" />

	<script type="text/javascript" src="/js/verify_domain.js"></script>
	
                <div id="leftSideContent">
                	<div class="verifyPage clearafter">
                        <div class="left dashboard">
                            <jsp:include page="/elements/menu_profile.jsp" />
                        </div>
                        <div class="right verifyContent">
                        	<% if (check.get("verifyMethod") != null || check.get("verifyUrl") != null || check.get("verifyCode") != null ) { %>
							<div class="message-error">
		                    	<span class="closeMessage"></span>
		                    	<% if (check.get("verifyMethod") != null ) { %>
		                    	<p><%=check.get("verifyMethod") %></p>
		                    	<% } %>
		                    	<% if (check.get("verifyUrl") != null ) { %>
		                    	<p><%=check.get("verifyUrl") %></p>
		                    	<% } %>
		                    	<% if (check.get("verifyCode") != null ) { %>
		                    	<p><%=check.get("verifyCode") %></p>
		                    	<% } %>
		                    </div>
							<% } %>
										
                            <section class="block">
                                <div class="blockContent">                            
                                    <div class="clearafter">
                                        <h3 class="title">Verify ownership of <a href="#">1stapp.org</a></h3>
                                        <p class="iconStar">
                                        	We treat your privacy seriously. Only owners and authorized webmasters 
                                            can change sites. Verification is required to avoid unauthorized access and 
                                            modifications.
                                            <br />
                                            Please complete the process using one of 2 easy methods below:
                                        </p>
                                        
                                        <h3 class="title">Verification Method</h3>
                                        <form method="post" action="">
                                        	<select name="verifyMethod">
												<option value="url" <%=ownerDomain.getVerifyMethod().equalsIgnoreCase("url") ? "selected=\"selected\"" : "" %>>Upload file</option>
												<option value="code" <%=ownerDomain.getVerifyMethod().equalsIgnoreCase("code") ? "selected=\"selected\"" : "" %>>Insert html code</option>
											</select>
											<div id="blockurl">
                                            <ul>
                                            	<li><span class="number">1</span>Download this HTML verification file <a href="/static/file?txt=<%=ownerDomain.getCodeVerify()%>"><%=ownerDomain.getCodeVerify()%>.txt</a></li>
                                                <li><span class="number">2</span>Upload the file to <a href="http://<%=ownerDomain.getDomain()%>"><%=ownerDomain.getDomain()%></a></li>
                                                <li>
                                                	<span class="number">3</span>
                                                    Confirm successful upload by visiting:
                                                    <br />
													<a target="_blank" href="http://<%=ownerDomain.getDomain()%>/<%=ownerDomain.getCodeVerify()%>.txt">http://<%=ownerDomain.getDomain()%>/<%=ownerDomain.getCodeVerify()%>.txt</a>
                                                </li>
                                                <li>
                                                	<span class="number">4</span>
                                                    Click Verify below. 
                                                    <br />
													To keep your verified status please do not remove the file after verification.
                                                </li>
                                            </ul>
                                            </div>
                                            <!-- blockcode -->
						    				<div id="blockcode">
				                                Add a meta tag to your home page HTML (If you are able to edit your home page).
				                                 Instructions:<br>
				    				    		<ul>
				                                	<li><span class="number">1</span> Copy the meta tag below, and paste it into your site's home page. 
				                                            It should go in the &lt;head&gt; section, before the first &lt;body&gt; section.<br>
				                                            <p style="border: 1px dotted black;">&lt;meta name="<%=UrlHelper.getServerUrl(request) %>/validation" content="<%=ownerDomain.getCodeVerify() %>" /&gt;</p><br><br>
				                                            Example:<br>
				                                            <div style="margin-left: 10px; color: #0072BC;">
				                                                &lt;html&gt;<br>
				                                                &lt;head&gt;<br>
				                                                <span style="color: green">&lt;meta name="<%=UrlHelper.getServerUrl(request) %>/validation" content="<%=ownerDomain.getCodeVerify() %>" /&gt;</span><br>
				                                                &lt;title&gt; My title &lt;/title&gt;<br>
				                                                &lt;/head&gt;<br>
				                                                &lt;body&gt;<br>
				                                                page contents<br>
				                                                &lt;/body&gt;<br>
				                                                &lt;/html&gt;<br>
				                                            </div>
				                                	</li>
				                                	<li><span class="number">2</span> Click Verify below. To keep your verified status please do not remove the meta tag after verification.</li>							
												</ul>
				    						</div>
                                            
                                            <div class="content-center">
                                                <button type="submit">Verify</button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <div class="blockShadow"></div>
                            </section>
                        </div>
                    </div>
                </div>
                
                <!-- right content -->
                <jsp:include page="/elements/right.jsp" />
                <!-- end right content -->
                
<jsp:include page="/layouts/footer.jsp" />